<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //数组中的元素
        let array = ["hdcms", "houdunren"];
        // array[2] = "cms";
        // array[array.length] = "baidu.com"
        // console.log(array)
        let hd = ["shop", "cms"];
        // array = [...array, ...hd];
        // console.log(array);
        // 推荐使用
        // array.push("shop", "cms");
        array.push(...hd); //返回数组的数量
        console.log(array);

        function rangeArray(begin, end) {
            const array = [];
            for (let i = begin; i <= end; i++) {
                array.push(i);

            }
            return array;
        }
        console.log(rangeArray(3, 5));
    </script>
</body>

</html>